//
//  EpointNavigationViewController.m
//  EpointFrame5
//
//  Created by wangzhigang on 14-5-15.
//  Copyright (c) 2014年 Epoint. All rights reserved.
//

#import "EpointNavigationViewController.h"
#import "EpointLoginViewController.h"
#import "UIView+Addtions.h"

@interface EpointNavigationViewController ()

@end

@implementation EpointNavigationViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (id)initWithRootViewController:(UIViewController *)rootViewController :(BOOL) isFirst{
    self.isFirst=isFirst;
   return [super initWithRootViewController:rootViewController];
}


- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}

- (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated{
    if (CurrentDeviceISiPad) {
        if(self.isFirst){
            self.isFirst=NO;
        }else{
            if (!XAppDelegate.isFullScreen) {
                XAppDelegate.isFullScreen=YES;
                XAppDelegate.leftWidth=0;
                [XAppDelegate.stackController setLargeLeftInset:PAD_LEFT_NAV_WIDTH];
                [XAppDelegate.stackController setLeftInset:PAD_LEFT_NAV_WIDTH];
                [XAppDelegate.stackController setStackWidth:AppWidth-PAD_LEFT_NAV_WIDTH];
                NSLog(@"isFullScreen=YES appw =%f PAD_LEFT_NAV_WIDTH=%f",AppWidth,PAD_LEFT_NAV_WIDTH);
                EpointNavigationViewController *uv = [[EpointNavigationViewController alloc]initWithRootViewController:viewController:NO];
                [XAppDelegate.stackController pushViewController:uv animated:NO];
                return;
            }
        }
    }
    [super pushViewController:viewController animated:animated];
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}



/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
